﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class GuestBook : System.Web.UI.Page
{
    AccessDAO dao = new AccessDAO();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            show();
            string s2 = "select * from billInfo where id=1";
            DataSet ds2 = dao.getDs(s2);
            this.dlProdu.DataSource = ds2;
            this.dlProdu.DataBind();
        }
    }

    private void show()
    {
        string ss = "select * from messageInfo order by id desc";
        DataSet ds = dao.getDs(ss);
        this.grlMessage.DataSource = ds;
        this.grlMessage.DataBind();
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.grlMessage.PageIndex = e.NewPageIndex;
        show();
    }
}
